Skip to content

Conversation

nslee333
Copy link
Member

@nslee333 nslee333 commented Oct 6, 2025

Introduces an extensible ClientOptions builder to prevent future semver breakage when adding client configuration options.

Changes:

  • New ClientOptions struct with fluent builder API for decode, max_queued_requests, and connection_logging_strategy
  • New spawn_tcp_client_task_with_options() function accepting ClientOptions
  • Original spawn_tcp_client_task() refactored to wrap new implementation (maintains backward compatibility)
  • ConnectionLoggingStrategy enum added (infrastructure for future state-driven logging)

Copy link

Summary of Changes

Hello @nslee333, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new, configurable logging strategy for TCP client connections, allowing users to specify the verbosity of connection-related logs. It achieves this by defining a new LoggingStrategy enum and providing an updated API for spawning TCP client tasks. The changes also include propagating this new logging parameter through the internal TCP client channel creation and task handling logic, ensuring that both standard and TLS client setups can leverage the new strategy. Additionally, a minor but important lifetime annotation fix was applied to FFI iterator functions to improve correctness.

Highlights

  • Configurable Logging Strategy: Introduced a new LoggingStrategy enum (All, StateDriven) to control the verbosity of TCP client connection logging, allowing for more granular control over log output.
  • New TCP Client Task Function: Added spawn_tcp_client_task_2, a new public function that allows specifying a LoggingStrategy when spawning a TCP client channel, providing flexibility for different logging needs.
  • Default Logging Behavior: The existing spawn_tcp_client_task and TLS client channel creation now internally utilize the new logging mechanism, defaulting to LoggingStrategy::All to maintain current logging behavior.
  • FFI Lifetime Fix: Corrected lifetime annotations for BitValueIterator and RegisterValueIterator in FFI functions within iterator.rs to ensure proper Rust reference handling and prevent potential lifetime errors.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a LoggingStrategy to control logging verbosity for TCP client connections and adds a new function spawn_tcp_client_task_2 to allow configuring it. My review has identified a few issues. The core logic for the LoggingStrategy is not yet implemented, so the new parameter has no effect. The new logging feature is not available for TLS connections. There are also some opportunities to improve the naming and documentation of the new public API. Overall, the direction is good, but the implementation is incomplete. Please see the detailed comments for specific suggestions.

nslee333 and others added 3 commits October 6, 2025 15:10
  - Rename spawn_tcp_client_task_2 to spawn_tcp_client_task_with_options
  - Rename decode parameter to decode_level for consistency
  - Add detailed documentation for ChannelLoggingType variants
  - Refactor TLS client to use ClientOptions instead of hardcoded values
@jadamcrain jadamcrain changed the title Add spawn_tcp_client_task_2 & LoggingStrategy Add spawn_tcp_client_task_with_options + ClientOptions Oct 13, 2025
@jadamcrain jadamcrain merged commit 0155898 into main Oct 13, 2025
25 checks passed
@jadamcrain jadamcrain deleted the feature/state-driven-logging branch October 13, 2025 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants